﻿#region Using Declarations

using System.Collections.Generic;
using System.Data.Entity;
using SocialFront.Core.Domain;
using SocialFront.Core.Persistence;

#endregion

namespace SocialFront.Core.Initializers
{
    public class StoreFrontContextIntializer : DropCreateDatabaseAlways<SocialFrontContext>
    {
        protected override void Seed(SocialFrontContext context)
        {
            buildFoos(context);
        }

        private void buildFoos(SocialFrontContext context)
        {
            var randomnames = new List<string>
                                  {
                                      "Jamika Hornick",
                                      "Aldo Dossey",
                                      "Daisey Delosreyes",
                                      "Bethann Loera",
                                      "Brynn Genao",
                                      "Shaun Asmussen",
                                      "Arletta Laven",
                                      "Caitlyn Stanton",
                                      "Boyce Pua",
                                      "Kizzie Motz"
                                  };

            var foos = new List<Foo>();

            for (var i = 1; i < 10; i++)
                foos.Add(new Foo { Foo1 = randomnames[i], Foo2 = "Bar" });

            foos.ForEach(f => context.Foos.Add(f));
            context.SaveChanges();
        }
    }
}
